<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>hello vue</title>
</head>

<body>
    <div id="app">
        <div v-bind:style='{border: borderStyle, width: widthStyle, height: heightStyle}'>1</div>
        <div v-bind:style='objStyles'>2</div>
        <div v-bind:style='[objStyles, overrideStyles]'>3</div>
        <button v-on:click='handle'>切换</button>
    </div>

    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript">
        var vm = new Vue({
            el: '#app',
            data: {
                borderStyle: '1px solid blue',
                widthStyle: '100px',
                heightStyle: '200px',
                objStyles: {
                    border: '1px solid green',
                    width: '200px',
                    height: '100px'
                },
                overrideStyles: {
                    border: '5px solid orange',
                    backgroundColor: 'blue'
                }
            },
            methods: {
                handle: function () {
                    this.borderStyle = '5px solid black';
                    this.objStyles.width = '100px';
                }
            }
        });
    </script>
</body>

</html>